package cn.hesion.leetcode;
/**
 * ClassName: MinSteps <br/>
 * Description: <br/>
 * date: 2022/5/23 7:05<br/>
 *
 * @author Hesion<br />
 * @version
 * @since JDK 1.8
 */

import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author: hesion
 * @create: 2022-05-23 07:05
 **/
public class MinSteps {
    public int minSteps(String s, String t) {
        int n = s.length();
        if(s.length()!=t.length()){
            return 0;
        }
        int[] hash = new int[26];
        for (int i = 0; i < n; i++) {
            ++hash[s.charAt(i)-'a'];
            --hash[t.charAt(i)-'a'];
        }
        int sum=0;
        for (int v : hash) {
            sum+=Math.abs(v);
        }
        return sum/2;
    }
}
